package com.zhp.config;

import com.baomidou.mybatisplus.extension.plugins.inner.TenantLineInnerInterceptor;
import com.zhp.handler.TenantHandler;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

/**
 * @author zhanghp
 * @since 2024/5/16 10:37
 */
@Component
public class BeanConfig {

    @Bean
    public TenantLineInnerInterceptor tenantLineInnerInterceptor(TenantConfig tenantConfig) {
        TenantLineInnerInterceptor tenantLineInnerInterceptor = new TenantLineInnerInterceptor();
        tenantLineInnerInterceptor.setTenantLineHandler(new TenantHandler(tenantConfig));
        return tenantLineInnerInterceptor;
    }
}
